<?php
include_once('ClsSebent/config.php');
if($zip!=0){
$qry="select * from zipcode where `zip code`='".$zip."'";
//echo $qry;
$result=mysql_query($qry);
$row=mysql_fetch_array($result);
$val1=$row["state abbreviation"];
$val2=$row["latitude"];
$val3=$row["longitude"];
$val4=$row["city"];
$val5=$row["state"];
}
//echo $val1.'*'.$val2.'*'.$val3.'*'.$val4.'*'.$val5;
//header("Location: reseller_reg.php?a=".$val1."&b=".$val2."&c=".$val3."&d=".$val4);
if($val1=='')
{?>
<script type="text/javascript">
alert('This zipcode does not exist in the list. Please enter this code in other box and other info too, for future use.');
</script>
<?php }
?>
<script type="text/javascript">
window.opener.document.frm.city.value='<?php echo $val4;?>';
window.opener.document.frm.longitude.value='<?php echo $val3;?>';
window.opener.document.frm.lattitude.value='<?php echo $val2;?>';
window.opener.document.frm.province.value='<?php echo $val5;?>';
window.opener.document.frm.abbr.value='<?php echo $val1?>';
window.close('fillvalues.php');
</script>
